using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;

namespace nToolbox.WinForms
{
	/// <summary>
	/// Helper class for accessing the Windows XP theme aware drawing utilities.
	/// </summary>
	public static class XP
	{
		/// <summary>
		/// Renders a themed GroupBox on top of the given control, usually a Panel.
		/// Overrides XP's blue header text and uses the control's foreground color.
		/// </summary>
		public static void GroupBoxWithControlText(Graphics graphics, Control targetControl)
		{
			GroupBoxRenderer.DrawGroupBox(
				graphics, 
				targetControl.ClientRectangle, 
				targetControl.Text, 
				targetControl.Font, 
				targetControl.ForeColor,
			    GroupBoxState.Normal);
		}
	}
}